package com.data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.Map;

public class JDoc implements Serializable {

	private static final long serialVersionUID = 3325396778057993001L;

	// data from crawler
	private String url;
	private String title;
	private String lastModified;
	private int size;
	private ArrayList<String> childLinks;
	private ArrayList<String> parentUrls;
	private ArrayList<String> stemmedTitle;
	private ArrayList<String> stemmedBody;

	// data from stemmer
	private Map<String, Integer> words;

	public JDoc(String url, String title, String lastModified, int size,
			ArrayList<String> childLinks, ArrayList<String> stemmedTitle,
			ArrayList<String> stemmedBody) {
		super();
		this.url = url;
		this.title = title;
		this.lastModified = lastModified;
		this.size = size;
		this.childLinks = childLinks;
		this.stemmedTitle = stemmedTitle;
		this.stemmedBody = stemmedBody;
	}

	public void addParent(String parent) {
		if (parent != null && parent.length() > 0) {
			if (parentUrls == null) {
				parentUrls = new ArrayList<String>();
			}
			if (!parentUrls.contains(parent)) {
				parentUrls.add(parent);
			}
		}
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getLastModified() {
		return lastModified;
	}

	public void setLastModified(String lastModified) {
		this.lastModified = lastModified;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public ArrayList<String> getChildLinks() {
		return childLinks;
	}

	public void setChildLinks(ArrayList<String> childLinks) {
		this.childLinks = childLinks;
	}

	public ArrayList<String> getParentUrls() {
		return parentUrls;
	}

	public void setParentUrls(ArrayList<String> parentUrls) {
		this.parentUrls = parentUrls;
	}

	public Map<String, Integer> getWords() {
		return words;
	}

	public void setWords(Map<String, Integer> words) {
		this.words = words;
	}

	public ArrayList<String> getStemmedTitle() {
		return stemmedTitle;
	}

	public ArrayList<String> getStemmedBody() {
		return stemmedBody;
	}

}
